<template>
  <div>

    <el-scrollbar>
      <el-table v-loading="statePage.loading" :header-cell-style="{background:'#eef1f6',color:'#606266'}" border
                :row-style="{height: '54.7px'}"
                style="font-size: 15px" stripe height="580px" :data="statePage.table">
        <el-table-column prop="companyName" label="公司名称" width="auto"/>
        <el-table-column prop="realTotal" label="充值金额" width="auto"/>
        <el-table-column prop="rechargeMoney" label="划拨金额+账户余额" width="auto"/>
      </el-table>
    </el-scrollbar>
    <el-pagination v-model:currentPage="statePage.currentPage"
                   layout="total,prev, pager, next, jumper"
                   :total="statePage.total"
                   @current-change="handleCurrentChange">
    </el-pagination>
  </div>


  <!--  <el-card shadow="always" style="width: 350px">
      <template #header>
        <div class="card-header">
          <span>划拨数据核查</span>
          <el-button class="button" text @click="Allocation">点击刷新</el-button>
        </div>
      </template>

      <div>
        <div class="card_item" style="color: #337ecc">
          <label>
            平台充值总额
          </label>
          <div class="text item">
            {{ total }}
          </div>
        </div>

        <div class="card_item" style="color: #67C23A">
          <label>
            总划拨金额加总余额
          </label>
          <div>
            {{ result }}
          </div>
        </div>
        <div class="card_item" style="color: #F56C6C">
          <div class="text item">
            {{ '审核结果:' + msg }}
          </div>
        </div>
      </div>

    </el-card>-->

</template>


<script lang="ts" setup>
import {ElMessage} from "element-plus";
import {AllocationReview} from "../../api/DataReview/Allocation";
import {onMounted, reactive, ref} from "vue";
import {STATUS} from "../../utils/status";

const dialogFormVisible = ref(false)

const statePage = reactive({
  currentPage: 1,
  total: 0,
  loading: true,
  table: [],
})


const msg = ref('');
onMounted(() => {
  Allocation()
})

function handleCurrentChange() {
  Allocation()
}

function Allocation() {
  statePage.loading = true
  AllocationReview({pageNum: statePage.currentPage})
      .then(function (response: any) {
        if (response.code == 200) {
          statePage.table = response.data.list;
          statePage.total = response.data.total
        } else {
          ElMessage.warning(response.msg)
        }
        statePage.loading = false
      }).catch(function (res: any) {
    statePage.loading = false
    ElMessage.error("页面加载失败")
  })

}


</script>

<style scoped lang="scss">
.card_item {
  display: flex;

  label {
    width: 180px;
  }
}
</style>
